<template>
  <a-submenu>
    <div slot="title">{{ parent.title }}</div>
    <template v-for="(item, i) in parent.child">
      <a-menu-item v-if="!item.child" :key="`menu_item_${i}_${index}`">{{ item.title}}</a-menu-item>
      <re-submenu v-else :key="`menu_item_${i}_${index}`" :parent="item"></re-submenu>
    </template>
  </a-submenu>
</template>

<script>
import menuCompinents from '_c/menu-page'
const { AMenuItem, ASubmenu } = menuCompinents
export default {
  name: 're-submenu',
  components: {
    AMenuItem,
    ASubmenu
  },
  props: {
    parent: {
      type: Object,
      default: () => ({})
    },
    index: Number
  }
}
</script>
